<template>
	<view>
		<lingquan v-if="PageCur=='lingquan'"></lingquan>
		<my v-if="PageCur=='my'"></my>
		<view class="cu-bar tabbar bg-white shadow foot">
			<view class="action" @click="NavChange" data-cur="lingquan">
				<view class='cuIcon-cu-image'>
					<image :src="'/static/tabbar/lingquan' + [PageCur == 'lingquan'?'_cur':''] + '.png'"></image>
				</view>
				<view :class="PageCur=='lingquan'?'text-blue':'text-gray'">领券</view>
			</view>
			<view class="action" @click="NavChange" data-cur="my">
				<view class='cuIcon-cu-image'>
					<image :src="'/static/tabbar/my' + [PageCur == 'my'?'_cur':''] + '.png'"></image>
				</view>
				<view :class="PageCur=='my'?'text-blue':'text-gray'">我的</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
		return {
				PageCur: 'lingquan'
			}
		},
		onLoad(options) {
			 setTimeout(function () {
			            console.log('start pulldown');
			        }, 1000);
			        //uni.startPullDownRefresh();
			        uni.startPullDownRefresh({
			            success:function(res){
						
			                console.log(res);  //success 返回参数说明
			            }
			        });  //这里
			
			
		},
		onPullDownRefresh() {
			
		        //监听下拉刷新动作的执行方法，每次手动下拉刷新都会执行一次
		        console.log('refresh');
		        setTimeout(function () {
		            uni.stopPullDownRefresh();  //停止下拉刷新动画
		        }, 10);
	
		    },
		
		methods: {
			NavChange: function(e) {
				this.PageCur = e.currentTarget.dataset.cur
			}
		}
	}
</script>

<style>

</style>
